/*! DataTables Bootstrap 3 integration
 * ©2011-2014 SpryMedia Ltd - datatables.net/license
 */

/**
 * DataTables integration for Bootstrap 3. This requires Bootstrap 3 and
 * DataTables 1.10 or newer.
 *
 * This file sets the defaults and adds options to DataTables to style its
 * controls using Bootstrap. See http://datatables.net/manual/styling/bootstrap
 * for further information.
 */
(function(window, document, undefined){

var factory = function( $, DataTable ) {
"use strict";


/* Set the defaults for DataTables initialisation */
$.extend( true, DataTable.defaults, {
	//language:LANG.dataTable,
	dom:
	"<'row-x'Atr><'container-fluid'<'text-left clearfix'ilp>>S",
	renderer: 'bootstrap',
	oLanguage: {
		sInfo: 'current _START_&nbsp;&nbsp;&nbsp;&nbsp;/&nbsp;&nbsp;&nbsp;&nbsp;_END_ count，Total _TOTAL_ count'
	},
	bLengthChange: false,
    serverSide:true,
    sort:false,
	displayLength:50,
	autoWidth:false,
    sAjaxDataProp:'content',
	serverData: function(sSource, aoData, fnCallback, oSettings){
		if(oSettings.oInit.disabledLoading) { return false; }
        if(!sSource){
            sSource = (oSettings.ajax && oSettings.ajax.url) || oSettings.ajax ;
        }
		if(/^\s*$/.test(sSource)){
			fnCallback({
                'draw':oSettings.iDraw,
                'recordsTotal':oSettings._iRecordsTotal,
                'recordsFiltered':oSettings._iRecordsTotal,
				'data':[]
			});
			return;
		}
		var ajaxData = oSettings.oAjaxData;
		
		if(ajaxData.hasOwnProperty('start')){
			ajaxData.pageNo = ajaxData.start+1;
		}
        var oInit = oSettings.oInit,params = $.param(ajaxData);
        if(oInit.formId){
            params += '&'+ $.param($('#'+oInit.formId).serializeArray());
        }
        if(oInit.attachParams){
            if(typeof oInit.attachParams === 'function'){
                params += '&'+ $.param(oSettings.oInit.attachParams(this));
            }else{
                params += '&'+ $.param(oSettings.oInit.attachParams);
            }
            
        }
		oSettings.jqXHR = $.ajax( {
			"dataType": 'JSON',
			"type": "POST",
			"url": sSource,
			"data": params,
            "mask":oInit.ajaxMask,              //配置此次请求是否需要遮罩层,默认为true
            "maskZIndex":oInit.ajaxMaskZIndex,  //配置此次请求遮罩层的zIndex
			"success": function(data){
                if(data && !data.status){
                    if($.isFunction(oInit.onfail)){
                        (function(data){
                            oInit.onfail(data)
                        }(data));
                    }
				}
				if(!data  ){
                    if(data){
                        oSettings.oLanguage.sEmptyTable = data.info;
                    }
                    data = {};
                    data['info'] = {
						'draw':oSettings.iDraw,
						'recordsTotal':0,
						'recordsFiltered':0,
						'data':[]
					};
				}
                data = data.info || data.data || [];
				if($.isArray(data)){
					var tmp ={};
					tmp[oSettings.sAjaxDataProp] = data;
					tmp['Total'] = data.length;
					data = tmp;
				}else{
					data['content'] = data.list || [];
					data['total'] = data.count;
					data['totalElements'] = data.count;
					data['totalPages'] = Math.ceil(data['total']/data['pageSize']);
					data['size'] = data.pageSize;
					data['number'] = data.pageNo;
					data['numberOfElement'] = data.pageNo;
					data['pageable'] = {
						offset:	(data['pageNo']-1) * data['pageSize'],
						page: data['pageNo'],
						pageNumber: data['pageNo'],
						pageSize: data.pageSize,
						size: data.pageSize
					};
					
				}
				data['draw'] == null ? data['draw'] = oSettings.iDraw : "";
				data[oSettings.sAjaxDataProp] instanceof Array ? "" : data[oSettings.sAjaxDataProp] = [];
                data['recordsTotal'] = data['Total'] || data['total'] || data[oSettings.sAjaxDataProp].length;
                data['recordsFiltered'] ? "" : data['recordsFiltered'] = data['recordsTotal'];
                var filterServerData = oSettings.oInit.filterServerData;
                if(typeof filterServerData === 'function') {
                    fnCallback(filterServerData(data)); //在数据渲染前，通过 filterServerData 方法，对数据做一次过滤
                } else {
				    fnCallback(data);
                }
			}
		});
	}
} );


/* Default class modification */
$.extend( DataTable.ext.classes, {
	sWrapper:      "dataTables_wrapper form-inline dt-bootstrap",
	sFilterInput:  "form-control input-sm",
	sLengthSelect: "form-control input-sm",
	sPageButton: '',
	sPaging: 'dataTables_paginate pull-left pagination paging_'
} );


/* Bootstrap paging button renderer */
DataTable.ext.renderer.pageButton.bootstrap = function ( settings, host, idx, buttons, page, pages ) {
	var api     = new DataTable.Api( settings );
	var classes = settings.oClasses;
	var lang    = settings.oLanguage.oPaginate;
	var btnDisplay, btnClass, $host = $(host), dataTableId = $host.attr('id').split('_')[0];

	var attach = function( container, buttons ) {
		var i, ien, node, button;
		var clickHandler = function ( e ) {
			e.preventDefault();
			if ( !$(e.currentTarget).hasClass('disabled') ) {
				api.page( e.data.action ).draw( false );
			}
		};

		for ( i=0, ien=buttons.length ; i<ien ; i++ ) {
			button = buttons[i];

			if ( $.isArray( button ) ) {
				attach( container, button );
			}
			else {
				btnDisplay = '';
				btnClass = '';

				switch ( button ) {
					case 'ellipsis':
						btnDisplay = '&hellip;';
						btnClass = 'disabled';
						break;

					case 'first':
						btnDisplay = lang.sFirst;
						btnClass = button + (page > 0 ?
							'' : ' disabled');
						break;

					case 'previous':
						btnDisplay = lang.sPrevious;
						btnClass = button + (page > 0 ?
							'' : ' disabled');
						break;

					case 'next':
						btnDisplay = lang.sNext;
						btnClass = button + (page < pages-1 ?
							'' : ' disabled');
						break;

					case 'last':
						btnDisplay = lang.sLast;
						btnClass = button + (page < pages-1 ?
							'' : ' disabled');
						break;

					default:
						btnDisplay = button + 1;
						btnClass = page === button ?
							'active' : '';
						break;
				}

				if ( btnDisplay ) {
					node = $('<li>', {
							'class': classes.sPageButton+' '+btnClass,
							'aria-controls': settings.sTableId,
							'tabindex': settings.iTabIndex,
							'id': idx === 0 && typeof button === 'string' ?
								settings.sTableId +'_'+ button :
								null
						} )
						.append( $('<a>', {
								'href': '#'
							} )
							.html( btnDisplay )
						)
						.appendTo( container );

					settings.oApi._fnBindAction(
						node, {action: button}, clickHandler
					);
				}
			}
		}
	};

	attach(
		$host.empty().html('<ul class="pagination"/>').children('ul'),
		buttons
	);
	$host.parent().css({'text-align':'left','line-height':'17px','padding-bottom': '5px','padding-top': '3px','font-size':'12px'});
};

DataTable.ext.aoFeatures.push( {
	"fnInit": function( oSettings ) {

		var node = $(oSettings.nTHead).find('tr th:first-child:has(:checkbox)');
		//var $dom = $('<div class="check-all-or-inverse"></div>');
		//if(node.size() > 0) {
		//	$dom.append('<button type="button" class="btn btn-sm btn-default checkAll" >'+(oSettings.oLanguage.checkAll?oSettings.oLanguage.checkAll:'checkAll')+'</button><button type="button" class="btn btn-sm btn-default inverse" >'+(oSettings.oLanguage.checkAll?oSettings.oLanguage.inverse:'inverse')+'</button>');
		//}
		var $tbody = $(oSettings.nTBody),
			$thead = $(oSettings.nTHead);

		var checkboxSelected = function(){
			var allCheckedSize = $tbody.find('tr td:first-child :checkbox:not([disabled])').size();
			var partCheckedSize = $tbody.find('tr td:first-child :checkbox:not([disabled]):checked').size()
			if(allCheckedSize > partCheckedSize){
				$thead.find('tr th:first-child :checkbox:not([disabled])').prop('checked', false);
			} else {
				$thead.find('tr th:first-child :checkbox:not([disabled])').prop('checked', true);
			}
		}

		oSettings.oInstance.parent().off('click.checkAll.DT');
		oSettings.oInstance.parent()
         //   .on('click.checkAll.DT', '.checkAll', function(e){
		//	$tbody.find('tr td:first-child :checkbox').prop('checked', true);
		//	$thead.find('tr th:first-child :checkbox').prop('checked', true);
		//}).on('click.checkAll.DT', '.inverse', function(e){
		//	$tbody.find('tr td:first-child :checkbox').each(function(){
		//		var $this = $(this);
		//		$this.prop('checked', !$this.prop('checked'));
		//	});
		//	checkboxSelected();
		//})
            .on('click.checkAll.DT', 'thead tr th:first-child :checkbox', function(e){
			if($(this).prop('checked')){
				$tbody.find('tr td:first-child :checkbox:not([disabled])').prop('checked', true);
			} else {
				$tbody.find('tr td:first-child :checkbox:not([disabled])').prop('checked', false);
			}
		}).on('click.checkAll.DT', 'tbody tr td:first-child :checkbox', function(){
			checkboxSelected();
		});
		//if(node.size() > 0){
		//	$(oSettings.nTable).parent().find('.actions').addClass('pull-right');
		//	return $dom[0];
		//}else{
			return '';
		//}
	},
	"cFeature": "A",
	"sFeature": "check-all-or-inverse"
} );

DataTable.ext.oApi.fnSetDisabledLoading = function(oSettings, bool) {
	oSettings.oInit.disabledLoading = !!bool;
}

DataTable.ext.oApi.fnAddDataAndDisplay = function ( oSettings, aData,index ) {

	/* Add the data and then replace DataTable's generated TR with ours */
	var iIndex = this.oApi._fnAddData( oSettings, aData );
	var nTr = oSettings.aoData[ iIndex ].nTr;
	oSettings.aoData[ iIndex ].nTr = nTr;

	oSettings.aiDisplay = oSettings.aiDisplayMaster.slice();

	var aInvisible = [];
	var i;
	var nTds = nTr.getElementsByTagName('td');
	for ( i=0 ; i<nTds.length ; i++ )
	{
		if (!oSettings.aoColumns[i].bVisible)
		{
			aInvisible.push( i );
		}
	}

	// Hidding invisible columns
	for ( i = (aInvisible.length - 1) ; i >= 0 ; i-- )
	{
		oSettings.aoData[iIndex]._anHidden[ i ] = nTds[aInvisible[i]];
		nTr.removeChild( nTds[aInvisible[i]] );
	}
    	if(!index){
        	this.find(oSettings.nTBody).prepend(nTr);
    	}else{
        	this.find(oSettings.nTBody).find('tr').eq(index).before(nTr);
    	}

	return nTr;
};

function fnAction(aData,max){
	var str = '';
	max = max || 2;
	if( $.isArray(aData) ){

		if( aData.length > max ){
			str = '<div class="dropdown">'
				+    '<a class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false" href="javascript:;">' +
				'<i class="fa fa-fw fa-plus visible-xs-inline-block"></i><span class="hidden-xs">'+(LANG._COMMON_ACTION_?LANG._COMMON_ACTION_:'Action')+' </span><i class="caret hidden-xs"></i></a>'
				+    '<ul class="dropdown-menu pull-right" role="menu" style="z-index: 1006;">'
				+       (function(){
					var s = '';
					for(var i = 0, len = aData.length; i < len; i ++){
						s += '<li>'+ aData[i] +'</li>';
					}
					return s;
				})()
				+    '</ul>'
				+ '</div>';

			str = '<div class="action-list">' + str + '</div>';
		} else if( aData.length == max ) {
			str = '<div class="action-short">' + aData.join('<i>|</i>') + '</div>';
		} else {
			str = aData.join('');
		}
	} else if(typeof aData == 'string'){
		str = aData;
	}

	return str;
}
DataTable.ext.oApi.fnAction = function ( oSettings, aData, max ) {
	return fnAction(aData, max);
};

$.fn.DataTable.fnAction = function(aData,max){
	return fnAction(aData,max);
};

/*
 * TableTools Bootstrap compatibility
 * Required TableTools 2.1+
 */
if ( DataTable.TableTools ) {
	// Set the classes that TableTools uses to something suitable for Bootstrap
	$.extend( true, DataTable.TableTools.classes, {
		"container": "DTTT btn-group",
		"buttons": {
			"normal": "btn btn-default",
			"disabled": "disabled"
		},
		"collection": {
			"container": "DTTT_dropdown dropdown-menu",
			"buttons": {
				"normal": "",
				"disabled": "disabled"
			}
		},
		"print": {
			"info": "DTTT_print_info"
		},
		"select": {
			"row-x": "active"
		}
	} );

	// Have the collection use a bootstrap compatible drop down
	$.extend( true, DataTable.TableTools.DEFAULTS.oTags, {
		"collection": {
			"container": "ul",
			"button": "li",
			"liner": "a"
		}
	} );
}

/*

 */

DataTable.ext.aoFeatures.push( {
	colReorder: null,
	_colVis: [],
	_columns: [],
	"fnInit": function( settings ) {
		var self = this;

		var table = settings.oInstance;
		var dtInit = settings.oInit;

		table.show();

		var target = table.attr('colvis-trigger');
		var tableId = table.attr('colvis-id');

		var options;
		try {
			options = JSON.parse(decodeURI(table.attr('colvis-options')));
		} catch(e) {
			options = [];
		}

		var colVis = dtInit.colVis;

		if(!(colVis instanceof Array && colVis.length > 0)){
			return;
		}

		if(colVis.length < settings.aoColumns.length){
			var map = {};
			for(var i = 0, len = colVis.length; i < len; i ++){
				map[colVis[i].index] = true;
				colVis[i].fixed = !!colVis[i].fixed;
				colVis[i].visible = !!colVis[i].visible;
			}

			for(var i = 0, len = settings.aoColumns.length; i < len; i ++){
				if(!map[i]){
					map[i] = true;
					colVis.push({index: i, visible: true, fixed: false});
				}
			}
		}

		table.data('_colVis', colVis.slice(0));
		table.data('_columns', $.extend(true, [], settings.aoColumns));

		if(options.length > 0 && options.length == colVis.length){
			self.fnUpdate(settings, table, options);
		} else {
			self.fnUpdate(settings, table, colVis);
		}

		$(target).click(function(){
			if($('.dataTable_ColVis').size() > 0){
				$('.dataTable_ColVis').remove();
			}
			var options;
			try {
				options = JSON.parse(decodeURI(table.attr('colvis-options')));
			} catch(e) {
				options = [];
			}
			if(options.length > 0 && options.length == colVis.length){
				self.fnShowSetting(settings, target, options, tableId);
			} else {
				self.fnShowSetting(settings, target, colVis, tableId);
			}
		});

		$(window).resize(function(){
			try {
				$('.dataTable_ColVis').css({
					left: $(target).offset().left - $('.dataTable_ColVis').outerWidth() - 12,
					top: $(target).offset().top - 9
				})
			} catch(e){}
		});

		$(document).on('click', '.dataTable_ColVis,' + target, function(e){
			e.stopPropagation();
		}).on('click', function(){
			$('.dataTable_ColVis').remove();
		})
	},
	fnShowSetting: function(settings, target, cv, tableId){
		var self = this;
		var $target = $(target);

		var $tpl = $(this.fnGetHtml(settings.aoColumns, cv));
		$tpl.css({
			position:'absolute',
			left: $target.offset().left - $tpl.outerWidth(),
			top: $target.offset().top - 3,
			zIndex: 1100
		}).appendTo('body');

		$tpl.on('click', '.visible', function(){
			var $this = $(this),
				value = $this.val(),
				listGroupItem = $tpl.find('.list-group-item').filter('[data-value='+value+']'),
				allCheckboxs = $tpl.find(':checkbox.visible:visible');

			if($this.is(':checked')){
				listGroupItem.show();
			} else {
				listGroupItem.hide();
			}

			if(allCheckboxs.size() == allCheckboxs.filter(':checked').size()){
				$tpl.find('.colvis_checked_all').prop('checked', true);
			} else {
				$tpl.find('.colvis_checked_all').prop('checked', false);
			}
		}).on('click', '.colvis_checked_all', function(){
			var $this = $(this),
				allCheckbox = $tpl.find(':checkbox.visible:visible'),
				listGroupItem = $tpl.find('.list-group-item').filter('[data-fixed="false"]');
			if($this.is(':checked')){
				allCheckbox.prop('checked', true);
				listGroupItem.show();
			} else {
				allCheckbox.prop('checked', false);
				listGroupItem.hide();
			}
		}).on('click', '.order', function(){
			var $this = $(this);
			$this.siblings('.order').removeClass('active');
			$this.addClass('active');
		}).on('click', '.moveUp', function(){
			var $active = $tpl.find('.list-group-item.active');
			var $prev = $active.prevAll('.list-group-item:visible').eq(0);
			if($prev.size() > 0){
				var $tmp = $active.clone();
				$active.replaceWith($prev.clone());
				$prev.replaceWith($tmp);
			}

		}).on('click', '.moveDown', function(){
			var $active = $tpl.find('.list-group-item.active');
			var $next = $active.nextAll('.list-group-item:visible').eq(0);
			if($next.size() > 0){
				var $tmp = $active.clone();
				$active.replaceWith($next.clone());
				$next.replaceWith($tmp);
			}
		}).on('click', '.apply', function(){
			var columns = [];
			var checkboxs = $tpl.find(':checkbox.visible');
			$tpl.find('.list-group-item').each(function(){
				var $this = $(this),
					index = $this.data('value'),
					fixed = $this.data('fixed'),
					o = {};

				o.index = index;
				o.visible = (checkboxs.filter('.visible[value='+index+']').prop('checked') ? true : false);
				o.fixed = fixed;
				columns.push(o);
			});

			self.fnSave(settings, columns, function(){
				$tpl.hide();

				var table = settings.oInstance;
				self.fnUpdate(settings, table, columns);
			});
		}).on('click', '.cancel', function(){
			$tpl.remove();
		}).on('click', '.close', function(){
			$tpl.remove();
		}).on('click', '.default', function(){
			self.fnReset(settings);
			
		});
	},
	fnUpdate: function(settings, table, cv){
		var recorder = [];
		for(var i = 0, len = cv.length; i < len; i ++){
			var o = cv[i];
			recorder.push(o['index']);
			table.fnSetColumnVis(i, (o['fixed'] || o['visible']), false);
		}

		if(!this.colReorder) {
			this.colReorder = new $.fn.dataTable.ColReorder( table );
			/**
			 * 列排序功能，默认允许用户直接拖动列表头进行排序。源码暂时没有提供禁用功能，
			 * 只能通过对源码绑定事件的代码进行反向处理（即，以相同的方式解绑事件监听）
			 */
			var aoColumns = this.colReorder.s.dt.aoColumns;
			for(var i = 0, len = aoColumns.length; i < len; i ++) {
				$(aoColumns[i].nTh).off('mousedown.ColReorder');
			}
		}
		this.colReorder.fnReset();
		this.colReorder.fnOrder(recorder);

		setTimeout(function(){
			if(table.is(':visible')){
				table.fnDraw();
			}
		}, 0)
	},
	fnSave: function(settings, columns, callback){
		var table = settings.oInstance;
		var tableId = table.attr('colvis-id');
		var columnsToString = encodeURI(JSON.stringify(columns));
		var param = {
			listId: tableId,
			columns: columnsToString
		}
		$.post(GlobalData.app + '/Home/HideList/addHideList', param, function(){
			table.attr('colvis-options', columnsToString);
			callback && callback();
		});
	},
	fnReset: function(settings){
		var table = settings.oInstance,
			colVis = table.data('_colVis') || [],
			columns = table.data('_columns') || [],
			colVisHtml = '',
			colRecorderHtml = '';

		for(var i = 0, len = columns.length; i < len; i ++){

			colVisHtml += '<div class="col-sm-8 m-b-xs" style="display:'+(colVis[i].fixed ? 'none':'block')+';">'
				+ 	 '<label class="row">'
				+		'<input type="checkbox" class="visible" '+((colVis[i].visible || colVis[i].fixed) ? 'checked' : '')+' value="'+colVis[i].index+'"/>'+columns[i].sTitle
				+	 '</label>'
				+ '</div>';

			colRecorderHtml += '<a class="list-group-item order" data-fixed="'+colVis[i].fixed+'" data-value="'+colVis[i].index+'" style="display:'+((colVis[i].fixed || !colVis[i].visible) ? 'none': 'block')+';">'+columns[i].sTitle+'</a>';
		}

		$('#colvis_checkbox_list').html(colVisHtml);
		$('#colvis_list_group').html(colRecorderHtml);
	},
	fnGetHtml: function(columns, colVis){
		var colVisHtml = '', colRecorderHtml = '';

		for(var i = 0, len = columns.length; i < len; i ++){

			colVisHtml += '<div class="col-sm-8 m-b-xs" style="display:'+(colVis[i].fixed ? 'none':'block')+';">'
				+ 	 '<label class="row">'
				+		'<input type="checkbox" class="visible" '+((columns[i].bVisible || colVis[i].fixed) ? 'checked' : '')+' value="'+colVis[i].index+'"/>'+columns[i].sTitle
				+	 '</label>'
				+ '</div>';

			colRecorderHtml += '<a class="list-group-item order" data-fixed="'+colVis[i].fixed+'" data-value="'+colVis[i].index+'" style="display:'+((colVis[i].fixed || !columns[i].bVisible) ? 'none': 'block')+';">'+columns[i].sTitle+'</a>';
		}

		var html = '<div class="m-r-lg panel b-a dataTable_ColVis" style="width:610px;">'
			+ 		'<div class="panel-heading pos-rlt b-b b-light">'
			+ 			'<span class="arrow right"></span>'
			+ 			'<span class="font-bold">'+LANG._COMMON_COLUMNS_SETTING_+'</span>'
			+ 			'<span class="text-muted m-l-sm pull-right">'
			+ 				'<a class="close" href="javascript:;"><i class="fa fa-times"></i></a>'
			+ 			'</span>'
			+ 		'</div>'
			+ 		'<div class="panel-body">'
			+ 			'<div class="container-fluid">'
			+ 				'<div class="row">'
			+ 					'<div class="col-sm-9">'
			+ 						'<div class="row">'+LANG._COMMON_SELECT_VISIBLE_COLUMNS_+'：<input type="checkbox" class="colvis_checked_all" style="vertical-align: top"></div>'
			+						'<div class="row checkbox" id="colvis_checkbox_list">'
			+ 							colVisHtml
			+ 						'</div>'
			+ 					'</div>'
			+ 					'<div class="col-sm-7">'
			+ 						'<div class="row m-b-sm">'+LANG._COMMON_SORT_+'：</div>'
			+ 						'<div class="row relative">'
			+ 							'<div class="col-sm-14">'
			+ 								'<div class="row">'
			+ 									'<div class="w-full panel b-a" style="height:230px; overflow: auto;">'
			+ 										'<div class="list-group list-group-sm" id="colvis_list_group">'
			+ 											colRecorderHtml
			+ 										'</div>'
			+ 									'</div>'
			+ 								'</div>'
			+ 							'</div>'
			+ 							'<div class="col-sm-2">'
			+ 								'<div class="text-2x" style="margin-top:75px;">'
			+ 									'<a class="moveUp" href="javascript:;"><i class="fa fa-caret-up text-primary"></i></a>'
			+ 									'<a class="moveDown" href="javascript:;" class="m-t-n-md"><i class="fa fa-caret-down text-primary"></i></a>'
			+ 								'</div>'
			+ 							'</div>'
			+ 						'</div>'
			+ 					'</div>'
			+ 				'</div>'
			+ 				'<div class="row"><hr class="line-xs"/></div>'
			+ 				'<div class="row m-t-sm">'
				/*+ 					'<div class="col-sm-7">'
				 + 						'<div class="form-group form-inline row">'
				 + 							'<label>默认显示天数：</label> '
				 + 							'<input type="text" class="form-control input-sm" style="width:3em;"> '
				 + 							'<label>天</label>'
				 + 						'</div>'
				 + 					'</div>'*/
			+ 					'<div class="col-sm-16 text-right">'
			+ 						'<div class="row">'
			+ 							'<button type="button" class="btn btn-sm btn-default default">'+LANG._COMMON_RESTORE_DEFAULTS_+'</button> '
			+ 							'<button type="button" class="btn btn-sm btn-default cancel">'+LANG._COMMON_CANCEL_+'</button> '
			+ 							'<button type="button" class="btn btn-sm btn-primary apply">'+LANG._COMMON_APPLY_+'</button>'
			+ 						'</div>'
			+ 					'</div>'
			+ 				'</div>'
			+ 			'</div>'
			+ 		'</div>'
			+ '</div>';

		return html;
	},
	"cFeature": "S",
	"sFeature": "ColReorder Configure"
} );


}; // /factory










// Define as an AMD module if possible
if ( typeof define === 'function' && define.amd ) {
	define( ['jquery', 'datatables'], factory );
}
else if ( typeof exports === 'object' ) {
    // Node/CommonJS
    factory( require('jquery'), require('datatables') );
}
else if ( jQuery ) {
	// Otherwise simply initialise as normal, stopping multiple evaluation
	factory( jQuery, jQuery.fn.dataTable );
}


})(window, document);

